package com.amos.core;

import com.alibaba.fastjson.annotation.JSONField;
import com.amos.constant.Constants;
import com.amos.util.StringUtils;
import lombok.Setter;

/**
 * Copyright © 2018 五月工作室. All rights reserved.
 *
 * @Package com.amos.muexamclient.service.dto
 * @ClassName PageDTO
 * @Description TODO
 * @Author Amos
 * @Modifier
 * @Date 2020/3/4 22:54
 * @Version 1.0
 **/
@Setter
public class PageDTO extends BaseDTO {
    @JSONField(serialize = false)
    private Integer pageNum;
    @JSONField(serialize = false)
    private Integer pageSize;

    public Integer getPageNum() {
        if (StringUtils.isNullOrEmpty(this.pageNum)) {
            return Constants.DEFAULT_PAGE_NUM;
        }
        return pageNum;
    }

    public Integer getPageSize() {
        if (StringUtils.isNullOrEmpty(this.pageSize)) {
            return Constants.DEFAULT_PAGE_SIZE;
        }
        return pageSize;
    }
}
